import { createApp } from 'vue'
import App from './App.vue'
import "./common.css"
import "../flexble.js"
import router from './router'
import 'element-plus/dist/index.css'
import notify from './global/index'
import axios  from './utils/http.js'
import pinia from './store/pinia.js'
import "./assets/css/iconfont.css"
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import Particles from 'particles.vue3'
import i18n from './local/i18.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import ElementPlus from 'element-plus'

const app = createApp(App)

// 先初始化i18n
app.use(i18n)

// 然后初始化其他插件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.config.globalProperties.$outsideHttp = axios.networkInstace // 配置外网的接口
app.config.globalProperties.$insideHttp = axios.instace // 配置本地串口接口
app.config.globalProperties.$downHttp = axios.downInstance // 配置导出excel的接口
app.config.globalProperties.$adminHttp = axios.adminInstance // 配置后台接口
app.config.globalProperties.$newAdminHttp = axios.adminInstanceLoading // 配置后台接口并且有进度提醒
app.config.globalProperties.$message = ElMessage

app.use(router)
app.use(pinia)
app.use(notify)
app.use(Particles)
app.use(ElementPlus, {
  locale: zhCn,
})

app.mount('#app')



